//reverse an unsigned integer
//e.g 2015 to 5102
//e.g 100 to 1
//e.g 0  to 0
//there is a bug!!!overflow
//2000000009

#include <iostream>
#include <cstdlib>
using namespace std;

//while-loop
unsigned int reverse_int(unsigned int n)
{
  unsigned int m = 0;
  while(n != 0) {
    m = m * 10 + n % 10;
    n = n/10;
  }
  return m;
}

int main(int argc, char *argv[])
{
  int m;
  if (argc == 2)
    m = atoi(argv[1]);
  else
    m = 1212;
  cout<<reverse_int((unsigned int)m)<<endl;

}
